unit ScriptableVcl;

//  $URL: http://delphiscriptedtesting.googlecode.com/svn/InterposedVclScripter/Main/ScriptableVcl.pas $
//  $Revision: 1222 $
//  $Date: 2010-05-02 15:23:36 +0000 (Sun, 02 May 2010) $

interface

{$IFDEF SCRIPTABLE}

  uses ComCtrls, StdCtrls, Menus, ExtCtrls;

  type
    TMenuItem = class(Menus.TMenuItem)
      published
        procedure Click; override;
      end;

    TButton = class(StdCtrls.TButton)
      published
        procedure Click; override;
      end;

    TPageControl = class(ComCtrls.TPageControl)
      published
        procedure Change; override;
        property  ActivePageIndex;
    end;

    TEdit = class(StdCtrls.TEdit)
      published
        procedure Change; override;
    end;

    TLabeledEdit = class(ExtCtrls.TLabeledEdit)
      published
        procedure Change; override;
    end;

{$ENDIF}

implementation

{$IFDEF SCRIPTABLE}

uses
  SysUtils, VclScripter;

{ TMenuItem }

procedure TMenuItem.Click;
begin
inherited;
if Assigned (Action) or Assigned (OnClick) then
  if Assigned(ScriptWriter) then ScriptWriter.LogToFile(Self, 'Click');
end;

{ TButton }

procedure TButton.Click;
begin
inherited;
if Assigned(ScriptWriter) then ScriptWriter.LogToFile(Self, 'Click');
end;

{ TPageControl }

procedure TPageControl.Change;
begin
inherited;
if Assigned(ScriptWriter) then
  begin
  ScriptWriter.LogToFile(Self, 'ActivePageIndex', Format('%d',[TabIndex]));
  ScriptWriter.LogToFile(Self, 'Change');
  end;
end;

{ TEdit }

procedure TEdit.Change;
begin
inherited;
if Assigned(ScriptWriter) then ScriptWriter.LogToFile(Self, 'Text', Text);
end;

{ TLabeledEdit }

procedure TLabeledEdit.Change;
begin
inherited;
if Assigned(ScriptWriter) then ScriptWriter.LogToFile(Self, 'Text', Text);
end;

{$ENDIF}

end.
